package com.wuchengdong.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wuchengdong.web.pojo.Review;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ReviewMapper extends BaseMapper<Review> {
    @Select("select u.name, review.comment, s.name AS service from review " +
            "left join `user` u on review.user_id = u.id " +
            "left join service s on review.service_id = s.id " +
            "LIMIT #{size} OFFSET #{offset}")
    List<Map<String, String>> getReviewList(@Param("offset") int offset, @Param("size") int size);
}
